Component({
  data: {
    selected: 0,
    isLogo:2,//number of logo
    color: "#9dd1af",
    selectedColor: "#107F37",
    list: [{
      pagePath: "/pages/indexPages/index/index",
      iconPath: "/images/index.png",
      selectedIconPath: "/images/indexSel.png",
      text: "首页"
    }, {
      pagePath: "/pages/activityPages/index/index",
      iconPath: "/images/activity.png",
      selectedIconPath: "/images/activitySel.png",
      text: "活动"
    },
    {
      pagePath: "/pages/indexPages/index/index",
      iconPath: "/images/logo.png",
      selectedIconPath: "/images/logo.png",
      text: ""
    },{
      pagePath: "/pages/servicePages/index/index",
      iconPath: "/images/service.png",
      selectedIconPath: "/images/serviceSel.png",
      text: "服务"
    },{
      pagePath: "/pages/myPages/index/index",
      iconPath: "/images/my.png",
      selectedIconPath: "/images/mySel.png",
      text: "我的"
    }]
  },
  attached() {
  },
  methods: {
    switchTab(e) {
      const data = e.currentTarget.dataset
      const url = data.path
      if(data.index == 2){
        data.index = 0
      }
      wx.switchTab({url})
      this.setData({
        selected: data.index
      })
    },
  }
})